// pages/aboutUs/aboutUs.js
var app = getApp();
Page({
  data: {
    ask     : "",
    complain: "",
    addr    : '',
    name    : '',
    about   : ''
  },
  calling:function(e){
    wx.makePhoneCall({
      phoneNumber : e.currentTarget.dataset.ask, //此号码并非真实电话号码，仅用于测试
      success     : function () {
        console.log("拨打电话成功！")
      },
      fail: function () {
        console.log("拨打电话失败！")
      }
    })
  },
  onLoad: function (options) {
    var that = this;
    var WxParse = require('../../wxParse/wxParse.js');
    wx.request({
      url: app.url + '/Article/aboutUs',
      method: 'post',
      data: {
        type: 'about'
      },
      success: function (res) {
        console.log(res.data.data);
        that.setData({
          ask: res.data.data.phone,
          complain: res.data.data.tsphone,
          name: res.data.data.name,
          addr: res.data.data.addr,
          about: WxParse.wxParse('about', 'html', res.data.data.about, that, 1)
        })    
    }
    })
  },
  onReady: function () {
  
  },
  onShow: function () {
    
  },
  onHide: function () {
  
  },
  onUnload: function () {
 
  },
  onPullDownRefresh: function () {
  
  },
  onReachBottom: function () {
  
  },
  onShareAppMessage: function () {
  
  }
})